<?php 
session_start();

//检测是否登录，若没有登录则转向登录页
if (!isset($_SESSION['userid'])) {
	header("Location:login.html");
	exit();
}

require 'connect.php';
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
$result = $con->query("SELECT * FROM admin WHERE adm_name = '$username' LIMIT 1");
$row = mysqli_fetch_array($result);
echo "用户信息：<br>";
echo "用户ID：" . $userid ."<br>";
echo "用户名：" . $username . "<br>";
echo "密码：" . $row['adm_password'];
echo '<a href="login.php?action=logout">注销</a>';
?>